package main

import (
    "fmt"
    "time"
)

func say(s string) {
    for i := 0; i < 3; i++ {
        time.Sleep(100 * time.Millisecond)
        fmt.Println(s)
    }
}

func main() {
    // 启动 Goroutine
    go say("Hello")
    say("World")

    // 使用 Channel
    ch := make(chan string)
    go func() {
        ch <- "来自 Channel 的消息"
    }()
    msg := <-ch
    fmt.Println(msg)
}